package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum OSEnum {

    crossPlatforms(1, "跨平台"),
    linux(2, "Linux"),
    mac(3, "Mac"),
    window(4, "Window");

    private static final Map<Integer, OSEnum> map;

    static {
        map = new HashMap<>();
        OSEnum[] values = OSEnum.values();
        for (OSEnum typeEnum : values) {
            map.put(typeEnum.getCode(), typeEnum);
        }
    }

    private int code;
    private String name;

    OSEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static Map<Integer, OSEnum> asMap() {
        return map;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
